home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / bin / extcompose (.txt) < prev    next >
Microsoft Windows Help File Content  |  1995-07-02  |  4KB  |  107 lines

  1. # This file Copyright (c) 1992 Z-Code Software Corp.
  2. # Permission to use, copy, modify, and distribute this material
  3. # for any purpose and without fee is hereby granted, provided
  4. # that the above copyright notice and this permission notice
  5. # appear in all copies, and that the name of Z-Code Software not
  6. # be used in advertising or publicity pertaining to this
  7. # material without the specific, prior written permission
  8. # of an authorized representative of Z-Code.  Z-CODE SOFTWARE
  9. # MAKES NO REPRESENTATIONS ABOUT THE ACCURACY OR SUITABILITY
  10. # OF THIS MATERIAL FOR ANY PURPOSE.  IT IS PROVIDED "AS IS",
  11. # WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES.
  12. if [ $# -lt 1 ]
  13.     echo "Usage:  $0 output-file-name" 1>&2
  14.     exit 1
  15. OUTFNAME=$1
  16. choosing=yes
  17. while [ $choosing = yes ]
  18.     echo ""
  19.     echo "Where is the external data that you want this mail message to reference?"
  20.     echo "    1 -- In a local file"
  21.     echo "    2 -- In an AFS file"
  22.     echo "    3 -- In an anonymous FTP directory on the Internet"
  23.     echo "    4 -- In an Internet FTP directory that requires a valid login"
  24.     echo "    5 -- Under the control of a mail server that will send the data on request"
  25.     echo ""
  26.     echo-n "Please enter a number from 1 to 5: \c"
  27.     read ans
  28.     case "$ans" in
  29.         1) accesstype=local-file ;;
  30.     2) accesstype=afs ;;
  31.     3) accesstype=anon-ftp ;;
  32.     4) accesstype=ftp ;;
  33.     5) accesstype=mail-server ;;
  34.     * ) echo "That is NOT one of your choices." 1>&2; continue ;;
  35.     esac
  36.     case "$accesstype" in
  37.         ftp | anon-ftp )
  38.         echo-n "Enter the full Internet domain name of the FTP site: "
  39.         read site
  40.         echo-n "Enter the name of the directory containing the file (RETURN for top-level): "
  41.         read directory
  42.         echo-n "Enter the name of the file itself: "
  43.         read name
  44.         echo-n "Enter the transfer mode (type 'image' for binary data, RETURN otherwise): "
  45.         read mode
  46.         if [ -n "$mode" ]
  47.         then mode=ascii
  48.         fi
  49.         echo "Content-type: message/external-body; access-type=$accesstype; name="\"$name\"\; > $OUTFNAME
  50.         echo-n "    site="\"$site\" >> $OUTFNAME
  51.         if [ -n "$directory" ]
  52.         then echo-n "; directory="\"$directory\">> $OUTFNAME
  53.         fi
  54.         echo-n "; mode="\"$mode\">> $OUTFNAME
  55.         echo "">> $OUTFNAME
  56.         choosing=no
  57.         ;;
  58.     local-file | afs )
  59.         name=
  60.         while [ -z "$name" ]
  61.         do
  62.             echo-n "Enter the full path name for the file: "
  63.         read name
  64.         if [ ! -f "$name" ]
  65.         then
  66.             echo "The file $name does not seem to exist."
  67.             name=
  68.         done
  69.         echo "Content-type: message/external-body; access-type=$accesstype; name="\"$name\"> $OUTFNAME
  70.         choosing=no
  71.         ;;
  72.     mail-server )
  73.         echo-n "Enter the full email address for the mailserver: "
  74.         read server
  75.         echo "Content-type: message/external-body; access-type=$accesstype; server="\"$server\"> $OUTFNAME
  76.         choosing=no
  77.         ;;
  78.         echo accesstype $accesstype not yet implemented
  79.         ;;
  80.     esac
  81. echo-n "Please enter the MIME content-type for the externally referenced data: "
  82. read ctype
  83. choosing=yes
  84. while [ $choosing = yes ]
  85.     echo "Is this data already encoded for email transport?"
  86.     echo "  1 -- No, it is not encoded"
  87.     echo "  2 -- Yes, it is encoded in base64"
  88.     echo "  3 -- Yes, it is encoded in quoted-printable"
  89.     echo "  4 -- Yes, it is encoded using uuencode"
  90.     read encode
  91.     case "$encode" in
  92.     1 ) cenc="" choosing=no ;;
  93.     2 ) cenc="base64" choosing=no ;;
  94.     3 ) cenc="quoted-printable" choosing=no ;;
  95.     4 ) cenc="x-uue" choosing=no ;;
  96.     * ) echo "That is not one of your choices." ;;
  97.     esac
  98. echo "" >> $OUTFNAME
  99. echo "Content-type: " $ctype >> $OUTFNAME
  100. if [ -n "$cenc" ]
  101. then echo "Content-transfer-encoding: " $cenc >> $OUTFNAME
  102. echo "" >> $OUTFNAME
  103. if [ "$accesstype" = "mail-server" ]
  104.     echo "Please enter all the data to be sent to the mailserver in the message body, "
  105.     echo "ending with ^D or your usual end-of-data character:"
  106.     cat >> $OUTFNAME
  107.